home *** CD-ROM | disk | FTP | other *** search
- /*
- ** vi_brace macro
- ** Provides brace matching much like vi's "showmatch"
- ** by William B. McCormick
- */
-
-
- init()
- {
- add_hook( 0, "vi_brace" );
- }
-
-
- vi_brace()
- {
- int i;
-
- c = currchar();
- if ( c==')' || c=='}' )
- {
- if ( brace_match() )
- {
- /*
- ** this should be some sort of machine-independent
- ** delay call. This is a comfortable speed on a
- ** model 80. Will probably have to be changed for
- ** a slower (or faster) machine.
- */
- for ( i=0; i<1000; i++ )
- ;
- brace_match();
- }
- else
- bell();
- }
- }
-
-